<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-add.php");
?>



<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-list-function.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <?php include 'modules/head.php'; ?>


</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="member">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content">




<div class="box member-add-box layui-form">
<h1>人员资料</h1>




<form id="add-form" method="post" action="detail-add-function.php?nav-itemed=member" enctype="multipart/form-data" class="layui-form">




  <div class="layui-form-item">
    <label class="layui-form-label">姓名<span>*</span></label>
    <div class="layui-input-block">
      <input type="text" name="ai_name" lay-verify="required" placeholder="请输入名字" autocomplete="off" class="layui-input">
    </div>
  </div>

    <div class="layui-form-item icon">

        <label class="layui-form-label">图片：</label>

        <div class="layui-input-block">
            <div class="image">
                <?php
                if ($detail['icon'] != 'alpha.gif' && $detail['icon'] != '') {
                    ?>
                    <img src="<?
                    if ($detail_storage) {
                        echo $detail_storage;
                    } else {
                        echo $site_domin;
                    }
                    ?>/uploadfiles/<? echo $theme_folder ?>/<? echo $detail['icon'] ?>" width="100"/>
                <?php } ?>
            </div>
            <a href="detail-delete-img.php?nid=<?php echo $trans_nid ?>&img=icon&sys_part=<? echo $system_part ?>">删除</a>
            <span class="title-data">(请上传像素<? echo $first_icon_data[0] ?>X<? echo $first_icon_data[1] ?>的图片,格式为jpeg)</span>
        </div>
    </div>

    <div class="layui-form-item icon">
        <label class="layui-form-label"> </label>
        <div class="layui-input-block"><input type="file" name="icon" onchange="fileChange(this);"/></div><em class="explain">(上传列表图标)</em></div>


  <div class="layui-form-item">
    <label class="layui-form-label">微信</label>
    <div class="layui-input-block">
      <input type="text" name="ai_weixin"   autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">邮箱</label>
    <div class="layui-input-block">
      <input type="text" name="ai_email"   autocomplete="off" class="layui-input">
    </div>
  </div>







    <?
    $unit_list=select_lines_all_items($table_Prefix."unit","nid desc","","0");
    ?>

    <div class="layui-form-item">
        <label class="layui-form-label">所属单位</label>
        <div class="layui-input-block">
            <select name="ai_unit" lay-search="" >
                <option value="">无</option>
                <? for($i=0;$i<count($unit_list);$i++){ ?>
                    <option value="<? echo $unit_list[$i]['nid'] ?>"><? echo $unit_list[$i]['nid'] ?> : <? echo $unit_list[$i]['name'] ?></option>
                <? } ?>
            </select>
        </div>
    </div>





  <div class="layui-form-item">
    <label class="layui-form-label">好感度</label>
      <div class="layui-input-block" >
<input type="radio" name="ai_favourable"  value="友好"     title="友好"      <? if($detail['favourable']=="友好")   {echo "checked";} ?>>
<input type="radio" name="ai_favourable"  value="互相仇恨"  title="互相仇恨"  <? if($detail['favourable']=="互相仇恨"){echo "checked";} ?>>
<input type="radio" name="ai_favourable"  value="仇视我方"  title="仇视我方"  <? if($detail['favourable']=="仇视我方"){echo "checked";} ?>>
<input type="radio" name="ai_favourable"  value="我方仇视"  title="我方仇视"  <? if($detail['favourable']=="我方仇视"){echo "checked";} ?>>
<input type="radio" name="ai_favourable"  value="我方不满"  title="我方不满"  <? if($detail['favourable']=="我方不满"){echo "checked";} ?>>
<input type="radio" name="ai_favourable"  value="不满我方"  title="不满我方"  <? if($detail['favourable']=="不满我方"){echo "checked";} ?>>
<input type="radio" name="ai_favourable"  value="普通"     title="普通"      <? if($detail['favourable']=="普通")    {echo "checked";} ?>>
      </div>

  </div>




<? $tag_list=select_lines_all_items($table_Prefix."option","nid desc","originate = 'member ' and type = 'tag' ","0"); ?>

<div class="layui-form-item">
<label class="layui-form-label">标签</label>

<div class="layui-input-block" >
<? foreach ($tag_list as $k => $v){?>
    <input type="checkbox" name="ai_relation[]"  value="<?echo $v['name']?>"     title="<?echo $v['name']?>"
           <? if($detail['relation']==$v['name'])   {echo "checked";} ?>>
<?;}?>

</div>
</div>











    <div class="layui-form-item">
    <label class="layui-form-label">身份证号 </label>
    <div class="layui-input-block">
      <input type="text" name="ai_idnumber" placeholder="请输入身份证号" autocomplete="off" class="layui-input" oninput="Getsex(this.value)" onporpertychange="Getsex(this.value)">


    </div>
    </div>

<script>

        function Getsex(psidno){
        var sexno,sex


        if(psidno.length==18)
        {
        sexno=psidno.substring(16,17);

            var tempid=sexno%2;
            if(tempid==0){
                sex='女'
            }else{
                sex='男'
            }

            document.getElementById('sex_show').innerHTML = sex;
            document.getElementById('sex_value').value = sex;


        }
        else if(psidno.length==15){
        sexno=psidno.substring(14,15);
            var tempid=sexno%2;
            if(tempid==0){
                sex='女'
            }else{
                sex='男'
            }

            document.getElementById('sex_show').innerHTML = sex;
            document.getElementById('sex_value').value = sex;

        }


        }
</script>





        <div class="layui-form-item">
    <label class="layui-form-label">性别</label>


	  <div class="layui-input-block">

      <input type="radio" name="ai_gender" value="男" title="男"
	  <? if($detail['gender']=="男"){echo "checked";} ?>
	  >
      <input type="radio" name="ai_gender" value="女" title="女"
	  <? if($detail['gender']=="女"){echo "checked";} ?>
	  >
    </div>



  </div>





   <div class="layui-form-item">
    <label class="layui-form-label">电话 </label>
    <div class="layui-input-block">
      <input type="text" name="ai_phone" placeholder="请输入电话"  autocomplete="off" class="layui-input" >
    </div>
  </div>











        <div class="layui-form-item">
            <label class="layui-form-label">常住地址</label>
            <div class="layui-input-block">
                <input type="text" name="ai_address" placeholder="请输入地址" autocomplete="off" class="layui-input" >
            </div>
        </div>







        <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block">
      <textarea name="ai_remark" placeholder="备注" class="layui-textarea"></textarea>
    </div>
  </div>










  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>





        </div>



<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>








<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
</body>
</html>
